/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.aal.bean;

import com.aal.entity.OrderDetail;
import java.util.List;
import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import javax.persistence.Query;

/**
 *
 * @author quy
 */
@Stateless
public class OrderDetailFacade extends AbstractFacade<OrderDetail> implements OrderDetailFacadeLocal {
    @PersistenceContext(unitName = "AAL-ejbPU")
    private EntityManager em;

    protected EntityManager getEntityManager() {
        return em;
    }

    public OrderDetailFacade() {
        super(OrderDetail.class);
    }
    public List<OrderDetail> viewOrderDetail(long orderID){
        Query query = em.createNamedQuery("OrderDetail.findByOrderID");
              query.setParameter("orderID",orderID);
        return query.getResultList();
    }
    
}
